<template>
	<view class="zh-agreement-start-up">
		<u-mask :show="props.showAgree" @click="handleClose"></u-mask>
		<view class="content" v-show="props.showAgree" @touchmove.stop.prevent="movestop" v-if="">
			<view class="title">服务协议和隐私政策</view>
			<view >
				<text>请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款，包括但不限于：为了更好的向你提供服务，我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。</text>
				<text>你可阅读<text>
				<text @click="navigateTo('/pages/auth/protocol')">《服务协议》</text>
				<text>和</text>
				<text @click="navigateTo('/pages/auth/privacy')">《隐私政策》</text>
				<text>了解详细信息。如果你同意，请点击下面按钮开始接受我们的服务。</text>
			</view>
			<view class="bottom display-flex justify-between">
				<button class="cancel" @click="handleUnAgree">暂不同意</button>
				<button class="sure" @click="handleAgree">我同意</button>
			</view>
		</view>
		<view class="content" v-show="showReAgree" @touchmove.stop.prevent="movestop" v-else>
			<view class="title">温馨提示</view>
			<view >
				<text>进入应用前，你需先同意</text>
				<text @click="navigateTo('/pages/auth/protocol')">《服务协议》</text>
				<text>和</text>
				<text  @click="navigateTo('/pages/auth/privacy')">《隐私政策》</text>
				<text>，否则将退出应用。</text>
			</view>
			<view class="bottom display-flex justify-between">
				<button class="cancel" @click="handleClose">取消</button>
				<button class="sure" @click="handleClick">确定</button>
			</view>
		</view>
	</view>
</template>

<script setup lang="ts">
	import { ref } from 'vue'
	
	const showReAgree = ref(false)
	
	const props = defineProps<{
		showAgree?: boolean
	}>()
	
	const emit = defineEmits(['close', 'click'])
	
	const navigateTo = (url:string) => {
		uni.navigateTo({
			url:url
		})
	}
	
	const handleUnAgree = () => {
		
	}
	
	const handleAgree = () => {
		
	}
	
	const handleClose = () => {
		//emit('close')
	}
	const handleClick = () => {
		emit('click')
	}
	const movestop = () => {}
</script>

<style lang="scss" scoped>
	.zh-agreement-start-up {
		.content {
			position:fixed;
			top:50%;
			left:50%;
			transform:translate(-50%, -50%);
			width: 626rpx;
			padding:52rpx 40rpx 54rpx;
			z-index:2;
			background-color: $uni-bg-card-color;
			border-radius: 10rpx;
			.title {
				color:$uni-color-primary;
				font-size:$uni-font-size-34;
				text-align: center;
				font-weight: bold;
			}
			.bottom {
				margin-top:60rpx;
				.cancel {
					width:255rpx;
					height: 89rpx;
					line-height: 89rpx;
					text-align: center;
					font-size:$uni-font-size-30;
					border:1rpx solid $uni-border-color;
					box-sizing: border-box;
					color:$uni-text-color-grey;
					background-color:$uni-bg-card-color;
				}
				.sure {
					width:255rpx;
					height: 89rpx;
					line-height: 89rpx;
					text-align: center;
					font-size:$uni-font-size-30;
					border:1rpx solid $uni-border-color;
					box-sizing: border-box;
					color:$uni-text-color-inverse;
					background-color: $uni-color-primary;
				}
			}
		}
	}
</style>